package cn.xuchunh.okhttpdemo;

import com.squareup.okhttp.Callback;
import com.squareup.okhttp.Headers;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;

import java.io.IOException;

/**
 * Created by XuChunH on 2015/12/31.
 */
public abstract class StringCallBack implements Callback {
    @Override
    public void onFailure(Request request, IOException e) {

    }

    @Override
    public void onResponse(Response response) throws IOException {
        onSuccess(response.code(), response.body().string(), response.headers());
    }

    public abstract void onSuccess(int statusCode, String responseString, Headers headers);

    public abstract void onError();

}
